package com.flyduck.mall.oms.h5.vo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import lombok.Data;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.List;

/**
 * @program: vueshop
 * @description:
 * @author: flyduck
 * @create: 2024-05-20 20:47
 **/
@Data
public class H5OrderPreviewRespVO implements Serializable {

    private AppAddressVO address;
    private List<AppCartItemVO> cartItems;
    private BigDecimal totalAmount;
    private BigDecimal freight;

    @Data
    public static class AppAddressVO implements Serializable{
        /**
         *
         */
        private Long id;

        /**
         *
         */
        private Long userId;

        /**
         *
         */
        private String name;

        /**
         *
         */
        private String tel;

        /**
         *
         */
        private String province;

        /**
         *
         */
        private String city;

        /**
         *
         */
        private String county;

        /**
         *
         */
        private String addressDetail;

        /**
         *
         */
        private String areaCode;

        /**
         * 邮政编码
         */
        private String postalCode;

        /**
         *
         */
        private Boolean isDefault;

        /**
         *
         */
        private Boolean isDelete;

        /**
         *
         */
        private LocalDateTime created;

        /**
         *
         */
        private LocalDateTime updated;

        private static final long serialVersionUID = 1L;

        private String address;

        public String getAddress() {
            return getProvince() + getCity() + getCounty() + getAddressDetail();
        }
    }

    @Data
    public static class AppCartItemVO implements Serializable{
        /**
         *
         */
        private Long id;

        /**
         *
         */
        private Long userId;

        /**
         *
         */
        private Long skuId;

        /**
         *
         */
        private Long productId;

        /**
         *
         */
        private Integer quantity;

        /**
         *
         */
        private LocalDateTime created;

        /**
         *
         */
        private LocalDateTime updated;


        private String productName;
        private String productImage;

        private String sku;
        private BigDecimal price;
    }
}
